package router

import (
	"context"
	"go_admin/internal/router/commonRouter"
	"go_admin/internal/router/systemRouter"
	"go_admin/internal/service"

	"github.com/gogf/gf/v2/net/ghttp"
)

var R = new(Router)

type Router struct{}

func (router *Router) BindController(ctx context.Context, group *ghttp.RouterGroup) {
	group.Group("/api", func(group *ghttp.RouterGroup) {
		group.Middleware(service.Middleware().MiddlewareCORS)
		group.Middleware(service.Middleware().MiddlewareGlobalHandlerResponse)

		systemRouter.R.BindController(ctx, group)
		commonRouter.R.BindController(ctx, group)
	})
}
